<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all"/>
    <link rel="stylesheet" href="__CSS__/admin.css" media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip {
            position: absolute;
            border: 1px solid #ccc;
            background: #333;
            padding: 2px;
            display: none;
            color: #fff;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">转账列表</li>
        </ul>
    </div>
    <form class="layui-form serch" action="{:url('admin/Account/index')}" method="post">
        <div class="layui-form-item" style="float: left;">
          <!--   <div class="layui-input-inline">
                <input type="text" name="nickname" lay-verify="title" id="search_nickname" autocomplete="off"
                       placeholder="请输入用戶姓名"
                       class="layui-input layui-btn-sm">
            </div> -->
            <div class="layui-input-inline">
                <input type="text" name="phone" lay-verify="title" id="search_phone" autocomplete="off"
                       placeholder="请输入手机号"
                       class="layui-input layui-btn-sm">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="pphone" lay-verify="title" id="search_pphone" autocomplete="off"
                       placeholder="请输入对方手机号"
                       class="layui-input layui-btn-sm">
            </div>
            <div class="layui-input-inline">
                <select name="status" class="layui-input layui-btn-sm" id="search_status">
                    <option value="">未选择</option>
                    <option value="1">转入</option>
                    <option value="2">转出</option>
                  <!--   <option value="3">驳回</option> -->
                </select>
            </div>
            <div class="layui-inline">
              <input type="text" class="layui-input test-item" placeholder="请选择开始时间" name="start" id="search_start">
            </div>
            <div class="layui-inline">
              <input type="text" class="layui-input test-item" placeholder="请选择结束时间" name="end" id="search_end">
            </div>
<!--             <div class="layui-inline">
                <input type="date" class="layui-input" name="start" id="search_start">
            </div>
            到
            <div class="layui-inline">
                <input type="date" class="layui-input" name="end" id="search_end">
            </div> -->

            <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">立即提交</button>
           <!--  <button class="layui-btn layui-btn-warm layui-btn-sm" type="button" onclick="toexcel()" >导出</button> -->
        </div>

    </form>

    
    <table class="layui-table" lay-size="sm">
        <colgroup>
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
            <col width="auto">
        </colgroup>
        <thead>
        <tr>
            <th>ID</th>
            <th>昵称</th>
            <th>手机号</th>
            <th>对方昵称</th>
            <th>对方手机号</th>
            <th>金额</th>
            <th>剩余数量</th>
            <th>类型</th>
            <th>状态</th>
            <th>备注信息</th>
            <th>时间</th>
        </tr>
        </thead>
        <tbody>
        {foreach $data as $key=>$value}
        <tr>
            <td>{$value['id']}</td>
            <td>{$value['user']}</td>
            <td>{$value['phone']}</td>
            <td>{$value['puser']}</td>
            <td>{$value['pphone']}</td>
           
            <td>{$value['money']}</td>
            <td>{$value['balance']}</td>
            <td>{$value['type']}</td>
            <td>{$value['class']}</td>
             <td>{$value['message']}</td>
            <td>{$value['create_time']}</td>
           
        </tr>
        {/foreach}
        </tbody>
    </table>
    <div style="padding:0 20px;">{$data->render()}</div>
    <table class='layui-table' style="display:none;" id="order_detail">
    <tbody id="order_content">
        
    </tbody>
    </table>
    {include file="public/foot"}
     <script type="text/javascript">
        layui.use('laydate', function(){
            var laydate = layui.laydate;
             lay('.test-item').each(function(){
                laydate.render({
                  elem: this
                  ,trigger: 'click',
                  type: 'datetime'
                });
              });
        });
          //通过

    function edit($id){
        layer.confirm('确认通过吗？', {
          btn: ['确认','取消'] //按钮
        }, function(){
        $.getJSON("{:url('admin/Withdrawals/edit')}",{id:$id},function(data){
            layer.msg(data.msg);
            if(data.status==200){ 
                setTimeout(function(){
                    window.location.reload();
                },1000)
            }
        })
        }, function(){

        });
    }
    //导出
    function toexcel(){
        // location.href = "www.baidu.com";
        window.location.href = "/admin/Account/toexcel?"+'nickname='+$('#search_nickname').val()+'&status='+$('#search_status').val()+'&phone='+$('#search_phone').val()+'&start='+$('#search_start').val()+'&end='+$('#search_end').val();
    }
     //驳回
    function del($id){
         layer.confirm('确认通过吗？', {
          btn: ['确认','取消'] //按钮
        }, function(){
        $.getJSON("del",{id:$id},function(data){
            if(data.status==200){ 
                layer.msg("操作成功", {time : 1000});            
                window.location.reload();
                
            }else{
                layer.msg(data.msg);
            }
        })
        }, function(){

        });
    }
    //详情
    function operat($id){
        var id=$id;
         $.getJSON("{:url('operat')}", {'id' : id}, function(data){
            var order_content = $('#order_content');
            var content = '';
            order_content.text('');
            if (data) {
                content = '';
                content += '<tr>';
                content += '<td>姓名:</td>';
                content += '<td>'+data.account_holder+'</td>';
                content += '</tr>';
                content += '<tr>';
                content += '<td>银行名称:</td>';
                content += '<td>'+data.bank+'</td>';
                content += '</tr>';
                content += '<tr>';
                content += '<td>银行卡号:</td>';
                content += '<td>'+data.bank_card+'</td>';
                content += '</tr>';
                content += '<tr>';
                content += '<td>开户支行:</td>';
                content += '<td>'+data.branch+'</td>';
                content += '</tr>';
            }
                order_content.append(content);                

            //捕获页
            layer.open({
                type: 1,
                shade: false,
                area: ['650px', '350px'], //宽高
                title: '账户详情', //不显示标题
                content: $('#order_detail'),
            });
        });
    }
    </script>


</div>
</body>
</html>
